﻿using AutoMapper;
using J.FoodManageSet.Application.Command.TableNumCommand;
using J.FoodRepository.Impl;
using J.FoodRepository.InterFace;
using MediatR;

namespace J.FoodManageSet.Application.CommandHandler.TableNumCommandHandler
{
    /// <summary>
    /// 桌号批量修改状态
    /// </summary>
    /// <returns></returns>
    public class TableNumUpDateCommandHandler : IRequestHandler<TableNumUpDateCommand, int>
    {
        private readonly ITableNumRepository _tableNumRepository;
        private readonly IMapper _mapper;

        public TableNumUpDateCommandHandler(ITableNumRepository tableNumRepository, IMapper mapper)
        {
            _tableNumRepository = tableNumRepository;
            _mapper = mapper;
        }
        public async Task<int> Handle(TableNumUpDateCommand request, CancellationToken cancellationToken)
        {
            var list = await _tableNumRepository.NumplUpDate(request.TableNumId);
            return list;
        }
    }
}
